// 预收 商品明细
const {DataTypes, db } = require("../db");
db.define('invoiceInfoYs', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,comment:'租户ID'}, 
iid:{type: DataTypes.INTEGER,allowNull:false,comment:'关联ID'}, 
billNo:{type: DataTypes.STRING(50),allowNull:false,comment:'票号'}, 
invId:{type: DataTypes.INTEGER,allowNull:false,comment:'商品ID'}, 
invName:{type: DataTypes.STRING(255),allowNull:false,defaultValue:(''),comment:'商品名称'}, 
spec:{type: DataTypes.INTEGER,allowNull:false,defaultValue:1,comment:'规格'}, 
calNum:{type: DataTypes.INTEGER,allowNull:false,defaultValue:0,comment:'1拆零换算系数'}, 
unit:{type: DataTypes.STRING(10),allowNull:false,defaultValue:(''),comment:'单位'},
unitId:{type: DataTypes.INTEGER,allowNull:false,comment:'单位Id'},
qty:{type: DataTypes.DECIMAL(20, 2),allowNull:false,defaultValue:0,comment:'数量'}, 
assQty:{type: DataTypes.STRING(100),defaultValue:(''),comment:'辅助数量'}, 
price:{type: DataTypes.DECIMAL(18, 6),defaultValue:0,comment:'单价'}, 
amount:{type: DataTypes.DECIMAL(18, 2),defaultValue:0,comment:'金额-返现金额'}, 
hxAmount:{type: DataTypes.DECIMAL(19, 2),defaultValue:0,comment:'使用预收款金额,核销金额'}, 
remark:{type: DataTypes.STRING(255),defaultValue:(''),comment:'备注'}, 
hxQty:{type: DataTypes.DECIMAL(20, 2),defaultValue:0,comment:'已核销数量'}, 
buId:{type: DataTypes.INTEGER,comment:''}, 
oldId:{type: DataTypes.INTEGER,comment:''}
}, {
    tableName: 'invoice_info_ys',
    timestamps: false,
    comment: '预收 商品明细'
});